package com.luojie.controller.user;


import com.luojie.result.Result;
import com.luojie.service.PositionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
@RequestMapping("/roger/user/position")
@Api(tags = "c端用户相关接口")
@Slf4j
public class PositionController
{
    @Autowired
    private PositionService positionService;

    @GetMapping
    @ApiOperation("查询地址")
    public Result<List<String>> selectPosition(){
        try {
            List<String> position = positionService.selectPosition();
            return Result.success(position);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return Result.error("查询地址失败");
    }
}
